package com.example.lambda;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * Created by butterfly on 2018/7/2.
 */
public class BufferedDemo {


    public static void main(String[] args) throws IOException {
        //具体操作由函数表达式传递决定
        processFile(bufferedReader -> bufferedReader.readLine()+bufferedReader.readLine()+bufferedReader.readLine());
    }

    /**
     * 定义方法从bf中读数据
     * @param brp 函数式接口
     * @throws IOExceptionPr
     */
    public static void processFile(BufferedReaderProcessor brp) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new FileReader("E:\\pp3\\java8-in-action\\java8-in-action\\src\\main\\java\\com\\example\\actionParam\\BufferedDemo.java"));
        String read = brp.read(bufferedReader);
        System.out.println(read);
    }
}
